package com.zaicheng.cloud;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

/**
 @author zaicheng
 @version 1.0
 @date 2022-04-19
 @email zzc15847256473@163.com
 */
@ConfigurationProperties("remotecall.client")
public class RemoteCallClientProperties {

    private  boolean  defaultToProperties = true;
    private String  defaultConfig = "default";
    private Map<String,RemoteCallClientProperties.RemoteCallClientConfiguration> config = new HashMap<>();

    public RemoteCallClientProperties() {
    }

    public boolean isDefaultToProperties() {
        return defaultToProperties;
    }

    public void setDefaultToProperties(boolean defaultToProperties) {
        this.defaultToProperties = defaultToProperties;
    }

    public String getDefaultConfig() {
        return defaultConfig;
    }

    public void setDefaultConfig(String defaultConfig) {
        this.defaultConfig = defaultConfig;
    }

    public Map<String, RemoteCallClientConfiguration> getConfig() {
        return config;
    }

    public void setConfig(Map<String, RemoteCallClientConfiguration> config) {
        this.config = config;
    }

    public  static class  RemoteCallClientConfiguration{

        private  Integer  connectTimeout;
        private  Integer readTimeout;

        public RemoteCallClientConfiguration() {
        }

        public Integer getConnectTimeout() {
            return connectTimeout;
        }

        public void setConnectTimeout(Integer connectTimeout) {
            this.connectTimeout = connectTimeout;
        }

        public Integer getReadTimeout() {
            return readTimeout;
        }

        public void setReadTimeout(Integer readTimeout) {
            this.readTimeout = readTimeout;
        }
    }
}
